|
![](/i/fill.gif) |
Wu Yang <wya### [at] cs wright edu> wrote:
> static void Reflect(......)
> {
> ofstream output("D:\\out.dat");
> ......
This is not an answer to your question per se, but do you think that's
the best way to go?
If you open the file for writing each time Reflect() is called, this
is not only inefficient (a system call for opening a file for writing can
be quite slow if done lots and lots of times) but you will also be destroying
any previous data which existed in the file (by default ofstream opens
the file for writing, not for appending, ie. if the file existed already,
it's clamped to 0 size).
You should only open the file once in some initialization routine, not
every time Reflect() is called.
And by the way, it's a good idea to check if opening the file succeeded.
Don't take the success for granted.
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |